<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:sinox="http://www.sinosoft.com.cn/sinox"
	xmlns:p="http://primefaces.org/ui">
	
	<ui:param name="compBean1Id" value="eventsTable" />
	
	<p:toolbar height="22px" styleClass="sino-toolbar-on-datatable">
		<p:toolbarGroup align="left">
	    	<div style="float:left;">
	    		<p:spacer width="10" height="25" />
	    	</div>
	    	<div style="float:left;margin-top:5px;">
	    		<h:outputText value="事件列表"/>
	    	</div>
	    </p:toolbarGroup>
	    
	    <p:toolbarGroup align="right">
	    	<p:commandButton title="添加" value="添加"
	    		onclick="SinoPortal.View.createWin('bpm-activity-scene','bpm-activity-addEvent','#{partViewBean.id}',{displayName:'添加事件'})"/>
			
			<p:commandButton title="删除" value="删除"
				actionListener="#{bpmAction.removeEventAction}"
				update="#{compBean1Id}">
				<h:inputHidden value="#{partViewBean.id}" />
			</p:commandButton>
	    </p:toolbarGroup>
	</p:toolbar>
	
	<p:dataTable id="#{compBean1Id}" var="af" value="#{partViewBean.activityEvents}"
        emptyMessage="请添加事件" selectionMode="multiple" rowIndexVar="afvar"
        selection="#{partViewBean.selectedEventRows}">
  		
  		<p:column headerText="序号" style="width:20px;">
  			<h:outputText value="#{afvar + 1}"/>
		</p:column>
		
		<p:column headerText="事件类型" style="width:150px;">
			<h:outputText value="#{af.type}" />
		</p:column>
		
		<p:column headerText="触发类型" style="width:150px;">
			<h:outputText value="#{af.event}" />
		</p:column>
		
		<p:column headerText="执行类型" style="width:150px;">
			<h:outputText value="#{af.continue}" />
		</p:column>
		
		<p:column headerText="是否有定时器" style="width:150px;">
			<h:outputText value="#{af.hasTimer}" />  
		</p:column>
  		
  		<p:column headerText="编辑" style="width:20px;">  
            <h:graphicImage title="选择一个代码" url="/img/component/system/code_set.png" style="cursor:pointer;" onclick="SinoPortal.View.createWin('window_codeset_content','window-codeset-default',null,{'codeSetId':'#{codeSetId}','codeId':'#{value}','formId':'#{formId}','elementId':'#{id}'})" />
        </p:column>
    </p:dataTable>
</ui:composition>